/**
 * create by young (young2f@outlook.com) on 2023/8/28
 */
'use strict';
const StringDecoder = require('string_decoder').StringDecoder;
const uuid = require('uuid');
const crypto = require('crypto');
function sha256Hmac(encryptText, secret) {
    try {
        return crypto.createHmac('sha256', secret)
            .update(encryptText)
            .digest('hex')
            .toUpperCase();
    } catch (e) {
        console.log('sha256Hmac crypto error,', e);
    }
}


function sha256(input) {
    const hash = crypto.createHash('sha256');
    hash.update(input);
    return hash.digest('hex');
}

const input = 'Admin@123';
const sha256Hash = sha256(input);
console.log('SHA256 哈希值:', sha256Hash);

//password=sha256(sha256(‘12345’) + ‘2019-08-15’) }
const temp=sha256(sha256Hash+'2023-08-28')
console.log(temp)

